#include <iostream>
using namespace std;

struct TreeNode {
    int val;
    TreeNode* left;
    TreeNode* right;
    TreeNode(int x)
	: val(x)
	, left(NULL)
	, right(NULL)
    {
    }
};

void proc(TreeNode* Root1, TreeNode* Root2, TreeNode* Father, int which)
{
    if (Root2 == nullptr) {
	return;
    }
    if (Root1 != nullptr && Root2 != nullptr) {
	Root1->val += Root2->val;
	proc(Root1->left, Root2->left, Root1, 1);
	proc(Root1->right, Root2->right, Root1, 2);
    } else {
	TreeNode* pNewTree = new TreeNode(Root2->val);
	if (which == 1) {
	    Father->left = pNewTree;
	} else {
	    Father->right = pNewTree;
	}
	proc(pNewTree->left,Root2->left,pNewTree,1);
	proc(pNewTree->right,Root2->right,pNewTree,2);
    }
}

TreeNode* mergeTrees(TreeNode* t1, TreeNode* t2)
{
}

int main(int argc, char* argv[])
{

    return 0;
}
